<?php


namespace App\Transformers;


use League\Fractal\TransformerAbstract;

class DiyTransFormer extends TransformerAbstract
{
    public function transform($data)
    {
        return [
             'id'=>$data->id ,
             'version' =>$data->version ?? '',
             'name' =>$data->name ?? '',
             'template_name' =>$data->template_name ?? '',
             'default_value' =>$data->default_value ?? '',
             'value' =>$data->value ?? '',
             'type' =>$data->type ?? '',
             'status' =>$data->status ?? '',
            'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
        ];
    }
}
